<template>
    <div>
        <svg :style="{ width, height }">
            <use :xlink:href="prefix + name" :fill="color"></use>
        </svg>
    </div>
</template>
<script setup lang='ts'>
import { ref } from 'vue'
//接收父组件的参数
defineProps({
    //xlink:href 属性前缀
    prefix: {
        type: String,
        default: "#icon-"
    },
    // 提供使用的图标名字
    name: String,
    // 颜色
    color: {
        type: String,
        default: ''
    },
    width: {
        type: String,
        default: '16px'
    },
    height: {
        type: String,
        default: '16px'
    },
})
</script>
<style lang='scss' scoped></style>